﻿@using Utils
@using Invoicing.Model.Orders
@model Invoicing.Model.Orders.BookOrderModel
@{
    ViewBag.Title = "Print";
    Layout = null;
}
<link href="@Url.Content("/content/styles/print_order.css")" type="text/css" rel="stylesheet" />

<div class="print">
    <table>
        <tr>
            <td class="main">
                <div class="top">
                    <b>乐清市宏越汽摩配有限公司
                    (@Invoicing.Web.Management.Common.GetOrderName(Model.Method))
                    </b>
                </div>
                <div class="banner">
                    <table>
                        <tr>
                            <td colspan="3">
                                <b>往来单位：</b>@Model.Customer.ComplexName
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 30%"></td>
                            <td style="width: 40%"><b>单据日期：</b>@Model.NoteDate.ToString("yyyy年MM月dd日")</td>
                            <td style="width: 30%"><b>NO：</b>@Model.OrderNo</td>
                        </tr>
                        
                    </table>
                </div>
                <div class="body">
                    <table>
                        <tr class="title">
                            <td style="width: 6%">序号</td>
                            <td style="width: 22%">产品型号</td>
                            <td style="width: 14%">材料</td>
                            <td style="width: 10%">加工</td>
                            <td style="width: 10%">规格</td>
                            <td style="width: 12%">数量</td>
                        </tr>
                        @for (var i=0;i<Model.Items.Count;i++)
                        {
                            var item = Model.Items[i];
                            <tr style="text-align: center">
                                <td>@(i+1)</td>
                                <td style="text-align: left">@item.Product.Module</td>
                                <td>@item.Material.MaterialName</td>
                                <td>@item.Process.ProcessName</td>
                                <td>@item.Size</td>
                                <td style="text-align: right">
                                    @(item.Quantity.ToString().RemoveLastZero()+"(只)")
                                </td>
                            </tr>
                        }
                    </table>
                </div>
            </td>
            <td class="side">
                <div>白(存)</div>
                <div>红(客)</div>
                <div>蓝(库)</div>
                <div>黄(记)</div>
            </td>
        </tr>
    </table>
    <div id="bt">
        <input type="button" value="打 印" onclick="Print()" />
    </div>
</div>

<script>
    function Print() {
        var obj = document.getElementById("bt");
        obj.parentNode.removeChild(obj);
        window.print();
    }
</script>

